import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/home/Home'
import Member from '@/components/member/Member'
import Search from '@/components/search/Search'
import Shopcart from '@/components/shopcart/Shopcart'
import NewsList from '@/components/news/NewsList'
import NewsDetail from '@/components/news/NewsDetail'
import PhotoList from '@/components/photo/PhotoList'
import PhotoDetail from '@/components/photo/PhotoDetail'
import GoodsList from '@/components/goods/GoodsList'
import GoodsDetail from '@/components/goods/GoodsDetail'
import GoodsComment from '@/components/goods/GoodsComment'

Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    redirect: {
      name: 'home'
    }
  },
  {
    name: 'home',
    path: '/home',
    component: Home
  },
  {
    name: 'member',
    path: '/member',
    component: Member
  },
  {
    name: 'search',
    path: '/search',
    component: Search
  },
  {
    name: 'shopcart',
    path: '/shopcart',
    component: Shopcart
  },
  {
    name: 'news.list',
    path: '/news/list',
    component: NewsList
  },
    // 新闻详情
  {
    name: 'news.detail',
    path: '/news/detail',
    component: NewsDetail
  },
    // 图文分享
  {
    name: 'photo.list',
    path: '/photo/list/:categoryId',
    component: PhotoList
  },
  {
    name: 'photo.detail',
    path: '/photo/detail',
    component: PhotoDetail
  },
  {
    name: 'goods.list',
    path: '/goods/list',
    component: GoodsList
  },
  {
    name: 'goods.detail',
    path: '/goods/detail/:id',
    component: GoodsDetail
  },
  {
    name: 'goods.info',
    path: '/goods/photo/info',
    component: NewsDetail
  },
  {
    name: 'goods.comment',
    path: '/goods/comment',
    component: GoodsComment
  }
  ]
})
